package com.siyao.redvip.image;

import android.graphics.Bitmap;

import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.siyao.redvip.R;

public class ImageLoaderOptions {
    private static DisplayImageOptions defaultOptions, headerOptions;

    private ImageLoaderOptions() {

    }

	public static DisplayImageOptions getDefaultInstance() {
        if (defaultOptions == null) {
            defaultOptions = new DisplayImageOptions.Builder().showImageOnLoading(R.drawable.ic_loading).showImageForEmptyUri(R.drawable.ic_load_faild)
                    .showImageOnFail(R.drawable.ic_load_faild).cacheInMemory(true).cacheOnDisc(true).considerExifParams(true)
                    .build();
        }
        return defaultOptions;
    }

    public static DisplayImageOptions getHeaderOptions() {
        if (headerOptions == null) {
            headerOptions = new DisplayImageOptions.Builder()
            .showImageOnLoading(R.drawable.ic_loading_me)
            .showImageForEmptyUri(R.drawable.ic_load_faild_me)
            .showImageOnFail(R.drawable.ic_load_faild_me)
            .cacheInMemory(true)
            .cacheOnDisc(true)
            .considerExifParams(true)
            .bitmapConfig(Bitmap.Config.RGB_565)
            .build();
        }
        return headerOptions;
    }

}
